package info.opensoaring.server.dao;

import info.opensoaring.server.jdo.Flight;

import java.util.Collection;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

public class OpenSoaringDaoJdo extends BaseDaoJdo implements OpenSoaringDao {

    public OpenSoaringDaoJdo(PersistenceManager pm) {
	super(pm);
    }

    @Override
    public Collection<Flight> getFlights() {
	Query query = pm.newQuery(Flight.class);
	Collection<Flight> flights = (Collection<Flight>) query.execute();
	return flights;
    }

    @Override
    public void storeFlight(Flight flight) {
	makePersistentInTx(flight);
    }

}
